package com.danco.training.zaneuskaya.serialization;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import org.apache.log4j.Logger;

public class FileSaverUtil {

	private static final Logger logger = Logger.getLogger(FileSaverUtil.class);

	public static void save(Object o) {
		try {

			String fileName = FileLoaderUtil.SERIALIZATION_FILE_NAME_PROPERTY;

			
			FileOutputStream os = new FileOutputStream(fileName);
			ObjectOutputStream oos = new ObjectOutputStream(os);
			oos.writeObject(o);

			
			os.close();
			
		} catch (IOException e) {
			logger.error(e.getMessage(), e);
		}
	}
}
